import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_chip/utils/toast_utils.dart';
import 'package:fsuper/fsuper.dart';

class GuidePage extends StatefulWidget {
  @override
  _GuidePageState createState() => _GuidePageState();
}

class _GuidePageState extends State<GuidePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        elevation: 1.0,
        backgroundColor: Theme.of(context).canvasColor,
        titleSpacing: 0.0,
        title: Text(
          "功能介绍",
          style: TextStyle(fontSize: 18),
        ),
      ),
      body: SingleChildScrollView(
        child: Column(
          children: <Widget>[
            FSuper(
              width: double.infinity,
              text: '·背景介绍',
              textSize: 16,
              textColor: Color(0XFF333333),
              margin: EdgeInsets.all(10),
              textAlign: TextAlign.left,
              textWeight: FontWeight.bold,
            ),
            FSuper(
              text:
                  '\t\t\t\t《单片机助手》前身为《51单片机助手》，该App以《51单片机助手》为原型进行改版，删除所有广告以及积分兑换阅读次数逻辑，学习内容完全免费，并且在此基础上新增论坛交流、资料交易等功能。',
              textAlignment: Alignment.centerLeft,
              textAlign: TextAlign.left,
              textColor: Color(0xFF666666),
              margin: EdgeInsets.only(left: 10, right: 10),
            ),
            FSuper(
              width: double.infinity,
              text: '·功能介绍',
              textSize: 16,
              textColor: Color(0XFF333333),
              margin: EdgeInsets.all(10),
              textAlign: TextAlign.left,
              textWeight: FontWeight.bold,
            ),
            FSuper(
              text:
                  '\t\t\t\t首页有单片机入门教程，您可以在闲暇之余翻阅以提升自己。所有教程均为作者在网络搜集整理，如有侵权，请联系作者删除。',
              textAlignment: Alignment.centerLeft,
              textAlign: TextAlign.left,
              textColor: Color(0xFF666666),
              margin: EdgeInsets.only(left: 10, right: 10),
            ),
            FSuper(
              text: '\t\t\t\t《蓝牙遥控》是一个基于经典蓝牙（蓝牙2.0，如HC-05）开发的小工具，您可以用它来控制智能小车。',
              textAlignment: Alignment.centerLeft,
              textAlign: TextAlign.left,
              textColor: Color(0xFF666666),
              margin: EdgeInsets.only(left: 10, right: 10),
            ),
            FSuper(
              text:
                  '\t\t\t\t《网络助手》是一个基于TCP协议的网络调试小工具，您可以用它来调试您的WIFI芯片如ESP8266等',
              textAlignment: Alignment.centerLeft,
              textAlign: TextAlign.left,
              textColor: Color(0xFF666666),
              margin: EdgeInsets.only(left: 10, right: 10),
            ),
            FSuper(
              text: '\t\t\t\t 更多小工具作者正在马不停蹄开发中，如果您有一些好用的小工具可以推荐给作者开发成app版',
              textAlignment: Alignment.centerLeft,
              textAlign: TextAlign.left,
              textColor: Color(0xFF666666),
              margin: EdgeInsets.only(left: 10, right: 10),
            ),
            FSuper(
              text:
                  '\t\t\t\t 也许您注意到首页底部有标价商品，没错这个功能获取可以为您带来收益，成为会员后您可以发布您原创资料或者电路设计、毕业设计、课程设计等进行交易',
              textAlignment: Alignment.centerLeft,
              textAlign: TextAlign.left,
              textColor: Color(0xFF666666),
              margin: EdgeInsets.only(left: 10, right: 10),
            ),
            FSuper(
              text:
                  '\t\t\t\t 论坛模块里您可以发布问答话题或者您单片机相关的任何话题与大家交流，请不要发布和单片机无关的内容，否则会限制您的发言。',
              textAlignment: Alignment.centerLeft,
              textAlign: TextAlign.left,
              textColor: Color(0xFF666666),
              margin: EdgeInsets.only(left: 10, right: 10),
            ),
            FSuper(
              width: double.infinity,
              text: '·最后',
              textSize: 16,
              textColor: Color(0XFF333333),
              margin: EdgeInsets.all(10),
              textAlign: TextAlign.left,
              textWeight: FontWeight.bold,
            ),
            FSuper(
              textAlignment: Alignment.centerLeft,
              textAlign: TextAlign.left,
              textColor: Color(0xFF666666),
              margin: EdgeInsets.only(left: 10, right: 10),
              spans: [
                TextSpan(
                    text:
                        '\t\t\t\t 新用户注册即可送三个月会员，《单片机助手》和《51单片机助手》账号不互通，请重新注册。另外有关于任何APP的问题，请加QQ群：'),
                TextSpan(
                    text: '734841860',
                    style: TextStyle(color: Colors.blue),
                    recognizer: TapGestureRecognizer()
                      ..onTap = () {
                        Clipboard.setData(ClipboardData(text: '734841860'));
                        Toast.show("群号已复制");
                      }),
              ],
            ),
            SizedBox(height: 40),
          ],
        ),
      ),
    );
  }
}
